package com.tieland.demo.bo;

import com.tieland.demo.entity.Organ;
import com.tieland.demo.dao.OrganDAO;

import javax.ejb.Stateless;
import javax.ejb.Local;
import javax.ejb.EJB;
import java.util.List;

/**
 * Created by IntelliJ IDEA.
 * User: Administrator
 * Date: 2008-3-12
 * Time: 8:37:53
 * To change this template use File | Settings | File Templates.
 */
@Stateless
@Local
public class OrganBOImpl implements OrganBO{
    @EJB
    OrganDAO organDAO;

    public Organ getOrgan(String organNo) {
       try {
            return organDAO.getOrgan(organNo);
        }
        catch (Exception e) {
            e.printStackTrace();
            return null;
        }
    }

    public void insertOrgan(Organ organ) {
        try {
            organDAO.insertOrgan(organ);
        }
        catch (Exception e) {
            e.printStackTrace();
        }
    }

    public void updateOrgan(Organ organ) {
       try {
            organDAO.updateOrgan(organ);
        }
        catch (Exception e) {
            e.printStackTrace();
        }
    }

    public List<Organ> getOrganList() {
       try {
            return organDAO.getOrganList();
        }
        catch (Exception e) {
            e.printStackTrace();
            return null;
        }
    }
}
